﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace WpfApp_SmartParking.Base.Converters
{
    public class MenyTypeConverter : IValueConverter
    {
        //将数据源转到目标
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null && parameter != null)
            {
                return int.Parse(value.ToString()!) == int.Parse(parameter.ToString()!);
            }
            return false;
        }

        //将目标转到数据源
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return parameter;
        }
    }
}


